<?php

namespace app\model;

use Parsedown;

class MiniParsedown extends Parsedown {
    protected function inlineImage($Excerpt) {
        $image = parent::inlineImage($Excerpt);
        if (isset($image['element']['name']) && $image['element']['name'] === 'img') {
            $image['element']['attributes']['style'] = 'max-width:100%;margin:10rpx auto;display:block;';
        }
        return $image;
    }
}